import { Injectable } from '@angular/core';
import { BaseService } from '@core/routes-services/base.service';
import { CacheService } from '@core/routes-services/cache.service';
import { HttpClient } from '@angular/common/http';

/**
 * 商盟角色自动升级配置 服务
 */
@Injectable()
export class SalesmanRoleSettingService extends BaseService {

  constructor(http: HttpClient, cacheService: CacheService) {
    super(http, cacheService);
  }

  base_url: any = 'api/marketSalesmanRoleSetting';


  /**
   * 修改
   *
   * @param id
   * @param entity
   * @returns {Promise<any>}
   */
  update(id: any, entity: any): Promise<any> {
    const url = this.base_url + '/' + id;
    return this.put(url, entity);
  }

  /**
   * 获取查看详情
   *
   * @param type
   * @returns {Promise<any>}
   */
  getByType(type: any): Promise<any> {
    const url = this.base_url + '/actions/type/' + type;
    return this.get(url);
  }

}
